package com.example.designpatterns.structural.flyweight;

/**
 * 客户端代码（具体使用）
 *
 * @author scott
 */
public class Client {

    public static void main(String[] args) {
        ChessPieceFactory chessPieceFactory = new ChessPieceFactory();

        ChessPiece blackPiece1 = chessPieceFactory.getChessPiece("black");
        System.out.println("blackPiece1:" + blackPiece1);
        blackPiece1.display(1, 2);

        ChessPiece blackPiece2 = chessPieceFactory.getChessPiece("black");
        System.out.println("blackPiece2:" + blackPiece2);
        blackPiece2.display(3, 4);

        ChessPiece whitePiece = chessPieceFactory.getChessPiece("white");
        System.out.println("whitePiece:" + whitePiece);
        whitePiece.display(5, 6);
    }

}
